home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 223_01 / avail.c < prev    next >
Text File  |  1980-01-01  |  640b  |  20 lines

  1. #define NOCCARGC  /* no argument count passing */
  2. /*
  3. ** Return the number of bytes of available memory.
  4. ** In case of a stack overflow condition, if 'abort'
  5. ** is non-zero the program aborts with an 'S' clue,
  6. ** otherwise zero is returned.
  7. */
  8.  
  9. external char *zzmem
  10.  
  11. avail(aburt) int aburt; {
  12.   char x;
  13.   if(&x < zzmem) {
  14.     if(aburt) abort('M');
  15.     return (0);
  16.     }
  17.   return (&x - zzmem);
  18.   }
  19.  
  20.